//
//  MessageVerifyViewController.m
//  DaiShengInvest
//
//  Created by davinci on 17/6/8.
//  Copyright © 2017年 davinci. All rights reserved.
//

#import "MessageVerifyViewController.h"

@interface MessageVerifyViewController ()


@property (nonatomic, weak)UIImageView * backImageView;

@property (nonatomic, weak)UIView * backViewOne;

@property (nonatomic, weak)UILabel * telLabel;

@property (nonatomic, weak)UITextField * telTextField;

@property (nonatomic, weak)UIButton * sentMesButton;

@property (nonatomic, weak)UIView * lineView;

@property (nonatomic, weak)UIView * backViewTwo;

@property (nonatomic, weak)UILabel * verifyLabel;

@property (nonatomic, weak)UITextField * verifyText;

@property (nonatomic, weak)UIView * lineViewTwo;

@property (nonatomic, weak)UIView * backViewThree;

@property (nonatomic, weak)UILabel * passwordLabel;

@property (nonatomic, weak)UITextField * passwordText;

@property (nonatomic, weak)UIView * lineViewThree;

@property (nonatomic, weak)UIView * backViewFour;

@property (nonatomic, weak)UILabel * emailLabel;

@property (nonatomic, weak)UITextField * emailText;

@property (nonatomic, weak)UIView * cityBackView;

@property (nonatomic, weak)UILabel * cityLabel;

@property (nonatomic, weak)UILabel * recommendLabel;

@property (nonatomic, weak)UIButton * yesButton;

@property (nonatomic, weak)UIButton * noButton;

@property (nonatomic, weak)UIView * recommendWordView;

@property (nonatomic, weak)UILabel * recommendWordLabel;

@property (nonatomic, weak)UITextField * recommendWordText;

@property (nonatomic, weak)UIButton * setupButton;


@property (nonatomic, strong)NSTimer * countDownTimer;


@end

@implementation MessageVerifyViewController

//倒计时总的秒数
static NSInteger  secondsCountDown = 60;


//显示导航栏
-(void)viewWillAppear:(BOOL)animated{
    
    self.navigationController.navigationBarHidden = NO;
    
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"注册";
    
//    self.view.backgroundColor = [UIColor whiteColor];
    
    
    [self setupNavBar];
    [self setupUI];
}


- (void)setupNavBar{
    
    UIButton * backButton = [[UIButton alloc] init];
    
    backButton.frame = CGRectMake(15 * SCREENH6, 5 * SCREENH6, 12 * SCREENH6, 20 * SCREENH6);
    [backButton setImage:[UIImage imageNamed:@"1返回"] forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(backToLogView) forControlEvents:UIControlEventTouchUpInside];

    UIBarButtonItem * leftButton = [[UIBarButtonItem alloc] initWithCustomView:backButton];
    
    self.navigationItem.leftBarButtonItem = leftButton;
}


- (void)setupUI{
    
    UIImageView * backImage = [[UIImageView alloc] init];
    
    backImage.image = [UIImage imageNamed:@"背景"];
    
    self.backImageView = backImage;
    
    [self.view addSubview:self.backImageView];
    
    
    UIView * backViewOne = [[UIView alloc] init];
    
    backViewOne.backgroundColor = [UIColor whiteColor];
    backViewOne.alpha = 0.1;
    
    self.backViewOne = backViewOne;
    
    [self.view addSubview:self.backViewOne];
    
    UILabel * telLabel = [[UILabel alloc] init];
    
    telLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    telLabel.textColor = [UIColor whiteColor];//ColorWithRGB(0xeeeeee);
    telLabel.text = @"手机号";
    
    self.telLabel = telLabel;
    
    [self.view addSubview:self.telLabel];
    
    UITextField * telText = [[UITextField alloc] init];
    
    telText.borderStyle = UITextBorderStyleNone;
    telText.backgroundColor = [UIColor clearColor];

    //设置光标颜色
    telText.tintColor = ColorWithRGB(0x808486);
    //修改占位符文字颜色
    NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
    attrs[NSForegroundColorAttributeName] = ColorWithRGB(0x808486);
    attrs[NSFontAttributeName] = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    telText.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入手机号" attributes:attrs];
    telText.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    telText.textColor = ColorWithRGB(0x808486);
    
    self.telTextField = telText;
    
    [self.view addSubview:self.telTextField];
    
    UIButton * sentBtn = [[UIButton alloc] init];
    
    [sentBtn setBackgroundColor:ColorWithRGB(0xa92c44)];
    sentBtn.layer.borderColor = [ColorWithRGB(0xa92c44) CGColor];
    //边框宽度
    sentBtn.layer.borderWidth = 1.0f;
    //处理圆角
    sentBtn.layer.cornerRadius = 3.0f;
    [sentBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    sentBtn.titleLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:13 * SCREENH6];
    
    [sentBtn setTitle:@"获取验证码" forState:UIControlStateNormal];
    [sentBtn addTarget:self action:@selector(didSentMessageButton) forControlEvents:UIControlEventTouchUpInside];
    
    self.sentMesButton = sentBtn;
    
    [self.view addSubview:self.sentMesButton];
    
    UIView * lineView = [[UIView alloc] init];
    
    lineView.backgroundColor = ColorWithRGB(0x526366);
    
    self.lineView = lineView;
    
    [self.view addSubview:self.lineView];
    
    UIView * backViewTwo = [[UIView alloc] init];
    
    backViewTwo.backgroundColor = [UIColor whiteColor];
    backViewTwo.alpha = 0.1;
    
    self.backViewTwo = backViewTwo;
    
    [self.view addSubview:self.backViewTwo];
    
    UILabel * verifty = [[UILabel alloc] init];
    
    verifty.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    verifty.textColor = ColorWithRGB(0xeeeeee);
    verifty.text = @"验证码";
    
    self.verifyLabel = verifty;
    
    [self.view addSubview:self.verifyLabel];
    
    
    UITextField * veriftyText = [[UITextField alloc] init];
    
    veriftyText.borderStyle = UITextBorderStyleNone;
    veriftyText.backgroundColor = [UIColor clearColor];
    
    //设置光标颜色
    veriftyText.tintColor = ColorWithRGB(0x808486);

    veriftyText.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入验证码" attributes:attrs];
    veriftyText.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    veriftyText.textColor = ColorWithRGB(0x808486);
    
    self.verifyText = veriftyText;
    
    [self.view addSubview:self.verifyText];
    
    UIView * lineViewTwo = [[UIView alloc] init];
    
    lineViewTwo.backgroundColor = ColorWithRGB(0x526366);

    self.lineViewTwo = lineViewTwo;
    
    [self.view addSubview:self.lineViewTwo];
    
    
    UIView * backViewThree = [[UIView alloc] init];
    
    backViewThree.backgroundColor = [UIColor whiteColor];
    backViewThree.alpha = 0.1;
    
    self.backViewThree = backViewThree;
    
    [self.view addSubview:self.backViewThree];
    
    UILabel * passwordLabel = [[UILabel alloc] init];
    
    passwordLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    passwordLabel.textColor = ColorWithRGB(0xeeeeee);
    passwordLabel.text = @"密码";
    
    self.passwordLabel = passwordLabel;
    
    [self.view addSubview:self.passwordLabel];
    
    UITextField * passwordText = [[UITextField alloc] init];
    
    passwordText.borderStyle = UITextBorderStyleNone;
    passwordText.backgroundColor = [UIColor clearColor];
    
    //设置光标颜色
    passwordText.tintColor = ColorWithRGB(0x808486);
    
    passwordText.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请设置登录密码" attributes:attrs];
    passwordText.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    passwordText.textColor = ColorWithRGB(0x808486);
    
    self.passwordText = passwordText;
    
    [self.view addSubview:self.passwordText];
    
    UIView * lineViewThree = [[UIView alloc] init];
    
    lineViewThree.backgroundColor = ColorWithRGB(0x526366);
    
    self.lineViewThree = lineViewThree;
    
    [self.view addSubview:self.lineViewThree];
    
    
    UIView * backViewFour = [[UIView alloc] init];
    
    backViewFour.backgroundColor = [UIColor whiteColor];
    backViewFour.alpha = 0.1;
    
    self.backViewFour = backViewFour;
    
    [self.view addSubview:self.backViewFour];
    
    UILabel * emailLabel = [[UILabel alloc] init];
    
    emailLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    emailLabel.textColor = ColorWithRGB(0xeeeeee);
    emailLabel.text = @"邮箱";
    
    self.emailLabel = emailLabel;
    
    [self.view addSubview:self.emailLabel];
    
    
    UITextField * emailText = [[UITextField alloc] init];
    
    emailText.borderStyle = UITextBorderStyleNone;
    emailText.backgroundColor = [UIColor clearColor];
    
    //设置光标颜色
    emailText.tintColor = ColorWithRGB(0x808486);
    
    emailText.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入常用邮箱" attributes:attrs];
    emailText.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    emailText.textColor = ColorWithRGB(0x808486);
    
    self.emailText = emailText;
    
    [self.view addSubview:self.emailText];
    
    
    UIView * cityBack = [[UIView alloc] init];
    
    cityBack.backgroundColor = [UIColor whiteColor];
    cityBack.alpha = 0.1;
    
    self.cityBackView = cityBack;
    
    [self.view addSubview:self.cityBackView];
    
    UILabel * cityLabel = [[UILabel alloc] init];
    
    cityLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    cityLabel.textColor = ColorWithRGB(0xeeeeee);
    cityLabel.text = @"省份城市";
    
    self.cityLabel = cityLabel;
    
    [self.view addSubview:self.cityLabel];
    
    

    UILabel * recommendLabel = [[UILabel alloc] init];
    
    recommendLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    recommendLabel.textColor = ColorWithRGB(0xeeeeee);
    recommendLabel.text = @"是否有推荐人";
    
    self.recommendLabel = recommendLabel;
    
    [self.view addSubview:self.recommendLabel];
    
    
    UIButton * yesButton = [[UIButton alloc] init];
    
    [yesButton setImage:[UIImage imageNamed:@"勾选"] forState:UIControlStateSelected];
    [yesButton setImage:[UIImage imageNamed:@"否"] forState:UIControlStateNormal];
    [yesButton setTitleColor:ColorWithRGB(0xbebebe) forState:UIControlStateNormal];
    [yesButton setTitleColor:ColorWithRGB(0xa92c44) forState:UIControlStateSelected];
    [yesButton setTitle:@"是" forState:UIControlStateNormal];
    [yesButton addTarget:self action:@selector(didYesButton) forControlEvents:UIControlEventTouchUpInside];
    yesButton.titleLabel.font = [UIFont systemFontOfSize:14 * SCREENH6];
    [yesButton setImageEdgeInsets:UIEdgeInsetsMake(0.0, -5, 0.0, 0.0)];
    [yesButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 5, 0, 0)];
    yesButton.selected = YES;
    
    self.yesButton = yesButton;
    
    [self.view addSubview:self.yesButton];
    
    UIButton * noButton = [[UIButton alloc] init];
    
    [noButton setImage:[UIImage imageNamed:@"勾选"] forState:UIControlStateSelected];
    [noButton setImage:[UIImage imageNamed:@"否"] forState:UIControlStateNormal];
    [noButton setTitleColor:ColorWithRGB(0xbebebe) forState:UIControlStateNormal];
    [noButton setTitleColor:ColorWithRGB(0xa92c44) forState:UIControlStateSelected];
    [noButton setTitle:@"否" forState:UIControlStateNormal];
    [noButton addTarget:self action:@selector(didYesButton) forControlEvents:UIControlEventTouchUpInside];
    noButton.titleLabel.font = [UIFont systemFontOfSize:14 * SCREENH6];
    [noButton setImageEdgeInsets:UIEdgeInsetsMake(0.0, -5, 0.0, 0.0)];
    [noButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 5, 0, 0)];
    
    self.noButton = noButton;
    
    [self.view addSubview:self.noButton];
    
    
    
    UIView * recommendWord = [[UIView alloc] init];
    
    recommendWord.backgroundColor = [UIColor whiteColor];
    recommendWord.alpha = 0.1;
    
    self.recommendWordView = recommendWord;
    
    [self.view addSubview:self.recommendWordView];
    
    UILabel * recommendWordLabel = [[UILabel alloc] init];
    
    recommendWordLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    recommendWordLabel.textColor = ColorWithRGB(0xeeeeee);
    recommendWordLabel.text = @"推荐码";
    
    self.recommendWordLabel = recommendWordLabel;
    
    [self.view addSubview:self.recommendWordLabel];
    
    UITextField * recommendWordText = [[UITextField alloc] init];
    
    recommendWordText.borderStyle = UITextBorderStyleNone;
    recommendWordText.backgroundColor = [UIColor clearColor];
    
    //设置光标颜色
    recommendWordText.tintColor = ColorWithRGB(0x808486);
    
    recommendWordText.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入推荐码" attributes:attrs];
    recommendWordText.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    recommendWordText.textColor = ColorWithRGB(0x808486);
    
    self.recommendWordText = recommendWordText;
    
    [self.view addSubview:self.recommendWordText];
    
    
    UIButton * setupButton = [[UIButton alloc] init];
    
    [setupButton setTitle:@"注册" forState:UIControlStateNormal];
    setupButton.titleLabel.font = [UIFont fontWithName:@"PingFangSC-Medium" size:15 * SCREENH6];//[UIFont systemFontOfSize:15];
    [setupButton setBackgroundColor:ColorWithRGB(0xa92c44)];
    setupButton.layer.borderColor = [[UIColor blackColor] CGColor];
    //边框宽度
    setupButton.layer.borderWidth =1.0f;
    //处理圆角
    setupButton.layer.cornerRadius =5.0f;
    [setupButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [setupButton addTarget:self action:@selector(didSetupButton) forControlEvents:UIControlEventTouchUpInside];
    
    self.setupButton = setupButton;
    
    [self.view addSubview:self.setupButton];
    
}


- (void)viewDidLayoutSubviews{
    
    [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.top.bottom.mas_equalTo(self.view);
    }];
    
    [self.backViewOne mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.view);
        make.width.mas_equalTo(345 * SCREENH6);
        make.height.mas_equalTo(54 * SCREENH6);
        make.top.mas_equalTo(self.view).offset(74 * SCREENH6);
    }];
    
    [self.telLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.backViewOne).offset(9 * SCREENH6);
        make.centerY.mas_equalTo(self.backViewOne);
        make.width.mas_equalTo(45 * SCREENH6);
    }];
    
    [self.telTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.backViewOne);
        make.leading.mas_equalTo(self.telLabel.mas_trailing).offset(42 * SCREENH6);
        make.height.mas_equalTo(self.telLabel);
        make.width.mas_equalTo(125 * SCREENH6);
    }];
    
    [self.sentMesButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.mas_equalTo(self.backViewOne).offset(- 12 * SCREENH6);
        make.width.mas_equalTo(98 * SCREENH6);
        make.height.mas_equalTo(33 * SCREENH6);
        make.centerY.mas_equalTo(self.backViewOne);
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(1 * SCREENH6);
//        make.width.mas_equalTo(323 * SCREENH6);
        make.leading.trailing.mas_equalTo(self.backViewOne);
        make.top.mas_equalTo(self.backViewOne.mas_bottom);
    }];
    
    [self.backViewTwo mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.lineView.mas_bottom);
        make.height.width.leading.trailing.mas_equalTo(self.backViewOne);
    }];
    
    [self.verifyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.width.height.mas_equalTo(self.telLabel);
        make.centerY.mas_equalTo(self.backViewTwo);
    }];
    
    [self.verifyText mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.width.height.mas_equalTo(self.telTextField);
        make.centerY.mas_equalTo(self.backViewTwo);
    }];
    
    [self.lineViewTwo mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(1 * SCREENH6);
        //        make.width.mas_equalTo(323 * SCREENH6);
        make.leading.trailing.mas_equalTo(self.backViewTwo);
        make.top.mas_equalTo(self.backViewTwo.mas_bottom);
    }];
    
    [self.backViewThree mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.width.height.mas_equalTo(self.backViewTwo);
        make.top.mas_equalTo(self.lineViewTwo.mas_bottom);
    }];
    
    [self.passwordLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.width.height.mas_equalTo(self.verifyLabel);
        make.centerY.mas_equalTo(self.backViewThree);
    }];
    
    [self.passwordText mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.width.height.mas_equalTo(self.verifyText);
        make.centerY.mas_equalTo(self.backViewThree);
    }];
    
    [self.lineViewThree mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(1 * SCREENH6);
        //        make.width.mas_equalTo(323 * SCREENH6);
        make.leading.trailing.mas_equalTo(self.backViewTwo);
        make.top.mas_equalTo(self.backViewThree.mas_bottom);
    }];
    
    
    [self.backViewFour mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.width.height.mas_equalTo(self.backViewThree);
        make.top.mas_equalTo(self.lineViewThree.mas_bottom);
    }];
    
    [self.emailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.width.height.mas_equalTo(self.passwordLabel);
        make.centerY.mas_equalTo(self.backViewFour);
    }];
    
    [self.emailText mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.width.height.mas_equalTo(self.passwordText);
        make.centerY.mas_equalTo(self.backViewFour);
    }];
    
    
    [self.cityBackView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.backViewFour.mas_bottom).offset(11 * SCREENH6);
        make.leading.trailing.width.height.mas_equalTo(self.backViewFour);
    }];
    
    
    [self.cityLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.height.mas_equalTo(self.emailLabel);
        make.centerY.mas_equalTo(self.cityBackView);
    }];

   
    [self.recommendLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.cityBackView.mas_bottom).offset(25 * SCREENH6);
        make.leading.height.mas_equalTo(self.cityLabel);
    }];
    
    
    [self.yesButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.recommendLabel);
        make.leading.mas_equalTo(self.recommendLabel.mas_trailing).offset(20 * SCREENH6);
        make.height.mas_equalTo(20 * SCREENH6);
        make.width.mas_equalTo(43 * SCREENH6);
    }];
    
    [self.noButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.yesButton);
        make.leading.mas_equalTo(self.yesButton.mas_trailing).offset(22 * SCREENH6);
        make.height.mas_equalTo(20 * SCREENH6);
        make.width.mas_equalTo(43 * SCREENH6);
    }];
    
    [self.recommendWordView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.width.height.mas_equalTo(self.cityBackView);
        make.top.mas_equalTo(self.recommendLabel.mas_bottom).offset(25 * SCREENH6);
    }];
    
    [self.recommendWordLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.height.mas_equalTo(self.recommendLabel);
        make.centerY.mas_equalTo(self.recommendWordView);
    }];
    
    [self.recommendWordText mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.height.mas_equalTo(self.emailText);
        make.centerY.mas_equalTo(self.recommendWordView);
    }];
    
    
    [self.setupButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.width.mas_equalTo(self.recommendWordView);
        make.top.mas_equalTo(self.recommendWordView.mas_bottom).offset(43 * SCREENH6);
        make.height.mas_equalTo(48 * SCREENH6);
    }];

}


- (void)didSentMessageButton{
    
    secondsCountDown = 60;
    
    //设置定时器
    _countDownTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(countDownAction) userInfo:nil repeats:YES];
    
    [self.sentMesButton setTitle:[NSString stringWithFormat:@"%ld秒后重新发送",secondsCountDown] forState:UIControlStateNormal];

}


//定时器的方法
- (void)countDownAction{
    
    secondsCountDown --;
    
    [self.sentMesButton setTitle:[NSString stringWithFormat:@"%lds后重新获取",secondsCountDown] forState:UIControlStateNormal];
    [self.sentMesButton setBackgroundColor:[UIColor clearColor]];
    [self.sentMesButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    self.sentMesButton.enabled = NO;
    //当倒计时到0时做需要的操作，button变成可选状态
    if(secondsCountDown==0){
        
        [_countDownTimer invalidate];
        
        [self.sentMesButton setTitle:@"获取验证码" forState:UIControlStateNormal];
        [self.sentMesButton setBackgroundColor:ColorWithRGB(0xa92c44)];
        [self.sentMesButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        
        self.sentMesButton.enabled = YES;
    }
}


//点击是否有推荐人，修改button的选中状态
- (void)didYesButton{
    
    if (self.yesButton.selected) {
        
        self.yesButton.selected = NO;
        self.noButton.selected = YES;
        
    }else{
        
        self.yesButton.selected = YES;
        self.noButton.selected = NO;
    }
    
    
}


//点击注侧按钮
- (void)didSetupButton{
    
    
    
}


- (void)backToLogView{
    
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)viewDidDisappear:(BOOL)animated{
    
    [_countDownTimer invalidate];
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
